import request from "@/utils/request.js";

// 获取用户信息
export function userInfo() {
	return request({
		url: '/user/info',
		method: 'get',
		isLoading: true
	})
}

//更新用户学习单词状态
export function updateLearn(wordId) {
	return request({
		url: '/user/updateLearned/'+wordId,
		method: 'get',
		isLoading: true
	})
}


//每日剩余
export function getRemaining(bookId) {
	return request({
		url: '/user/getTodayWord/'+bookId,
		method: 'get',
		isLoading: true
	})
}
//今日是否已经生成 
export function getTodayPlan(bookId) {
	return request({
		url: '/user/selectByCreateTime/'+bookId,
		method: 'get',
		isLoading: true
	})
}
//学习了多少单词
export function getStudyWord(bookId) {
	return request({
		url: '/user/selectStudyWord/'+bookId,
		method: 'get',
		isLoading: true
	})
}


//用户学习数据

export function getStudyData() {
	return request({
		url: '/studyRecord/getData',
		method: 'get',
		isLoading: true
	})
}


// export function getStudyData() {
// 	return request({
// 		url: '/studyRecord/getData',
// 		method: 'get',
// 		isLoading: true
// 	})
// }   updateRead

//更新用户阅读喜欢
export function updateReading(data) {
	return request({
		url: '/user/updateRead',
		method: 'post',
		data,
		isLoading: true
	})
}

